package com.itheima.service;

import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;

import java.util.List;
import java.util.Map;

public interface OrderService {

    Result order(Map map) throws Exception;

    Map findByOrderId(Integer orderId) throws Exception;

    Integer findCountByDate(String currentDateStr);

    Integer findCountByDateAndVisited(String currentDateString);

    Integer findCountByThisWeek(String mondayString, String currentDateString);

    Integer findCountByThisWeekAndVisited(String mondayString, String currentDateString);

    Integer findCountByThisMonth(String firstDayOfThisMonthStr, String currentDateString);

    Integer findCountByThisMonthAndVisited(String firstDayOfThisMonthStr, String currentDateString);

    /* ========================================================================================================== */

    /**
     * 1.分页+模糊查询
     *
     * @param pageBean
     * @return
     */
    PageResult getPage(QueryPageBean pageBean) throws Exception;

    /**
     * 2.添加客户预约
     *
     * @param setMealIds
     * @param map
     * @return
     * @throws Exception
     */
    Result create(Integer[] setMealIds, Map map) throws Exception;

    /**
     * 3.编辑预约信息
     *
     * @param id
     */
    void updateById(Integer id);

    /**
     * 4.后台取消预约
     *
     * @param id
     */
    void deleteById(Integer id);

    List<Map<String,Object>> findByMemberId(Integer id) throws Exception;
}
